package org.example;

public class Test2 {
    public static void main(String[] args){
        String str = getArrayData(new int[]{11,22,33});
        System.out.println(str);
    }
    public static String getArrayData(int[] arr){
        if(arr==null){
            return null;
        }
        StringBuilder sb = new StringBuilder("[");
        for(int i=0;i<arr.length;i++){
            if(i==arr.length-1){
                sb.append(arr[i]).append("]");
            }else{
                sb.append(arr[i]).append(",");
            }
        }
        return sb.toString();
    }
}
